Devices and methods for detecting USB devices attached to a USB charging port

ABSTRACT

Methods and devices for detecting USB devices attached to a USB charging port including a USB port having a first data line D+, a second data line D−, and a power line are disclosed. A USB device is attached to the USB port; applying power to the USB device by the power line; applying a first voltage to the line D+ at the USB port by a first impedance; applying a second voltage to the line D− at the USB port by a second impedance. The voltages on the line D+ and the line D− are then monitored at the USB port. If the voltage on the line D+ is approximately equal to a first predetermined value for a predetermined period and the voltage on the line D− is below a second predetermined value, then the USB device is determined to be of an alpha type device.

This application is a continuation of U.S. Nonprovisional patentapplication Ser. No. 13/298,204, filed Nov. 16, 2011, which claimspriority to U.S. Provisional Patent Application Nos. 61/414,780, filedon Nov. 17, 2010 and 61/414,791, filed on Nov. 17, 2010, which areincorporated herein by reference in their entirety.

BACKGROUND

Many different battery-powered devices are charged via a USB connection.Charging a battery in a USB device commences with attaching the USBdevice to a host device that is capable of providing current to chargethe batteries in the USB device. Subsequent to attachment, adetermination is made as to the type of USB device and the type of hostdevice that are attached together. If a charging port is detected, thecharging port provides current to charge the batteries in the USBdevice.

Over time, several different battery charging specifications have beendeveloped for different charging ports. The different battery chargingspecifications have created some conflicts between different chargingports and different USB devices. Accordingly, not all battery-poweredUSB devices will enter a charging mode when attached to all chargingports.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of the charge detection circuit of a USBdevice per specification BC1.1.

FIG. 2 is a schematic diagram of an embodiment of a USB charging port.

FIG. 3 is a flow chart describing the operation of the charging port ofFIG. 2.

DETAILED DESCRIPTION

The universal serial bus (USB) has become a dominant device fortransmitting data between computers and other electronic devices. Theelectronic devices include peripherals, such as printers and keyboards,and portable devices, such as cellular telephones and recording devices.These electronic devices are referred to herein collectively as USBdevices. The computer or other device that controls the USB is referredto as the host device or simply the host. The USB has four conductors,two power lines and two data lines. The two power lines are referred toas Vbus and ground and the two data lines are referred to as D+ and D−.

The use of the USB enables USB devices to communicate with a host and tobe powered by the host while using a single USB cable. Morespecifically, the power lines, Vbus and ground, provide power to the USBdevice and the data lines, D+ and D−, provide the data communicationsbetween the host and the USB device. In the case of battery-powered USBdevices, the power lines are able to charge the batteries as describedin greater detail below.

Many battery-powered USB devices, such as cellular telephones use asingle USB port for data communications and power. A user can rechargethe batteries by attaching a USB cable between the single USB port and ahost. Due to the limited power that can be output from some hosts, suchas some computers, many battery-powered USB devices are charged byconnecting the USB port of the USB device to a wall mounted batterycharger. The wall mounted battery chargers are capable of supplyingsignificantly more power than some computers or other hosts.

USB specifications dictate the manner in which USB devices detectbattery chargers (charging ports) and the manner in which they charge.Over time, two primary specifications related to battery charging of USBdevices have been developed, BC1.1 and BC1.2. The specification BC1.1was adopted by the USB Implementers Forum in April of 2009. Thespecification BC1.1 was replaced by the more advanced specificationBC1.2, which was adopted by the USB Implementers Forum in December of2010. However, there are many USB devices on the market and in use thatuse the older specification BC1.1. Many of these USB devices that usethe specification BC1.1 are not able to charge when connected to acharging port that is operating per the specification BC1.2. Tocomplicate the matter, some manufacturers use proprietary USB chargingspecifications that do not operate with other USB devices or hosts.

Host devices and methods of operating host devices that enable BC1.1,BC1.2, and some proprietary USB devices to be charged from a singlecharging port are disclosed herein. The charging port described hereinmay be a dedicated charging port (DCP), a charging downstream port(CDP), or a standard downstream port (SDP). A dedicated charging port isable to provide approximately 1.5 amperes to a USB device whereas astandard downstream port may only be able to supply approximately500-900 mA to a USB device.

Reference is made to FIG. 1, which is a schematic diagram of the chargedetection circuit 100 of a USB device 104 complying with at least oneversion of the USB battery charging specification BC1.1. The chargedetection circuit 100 is used by the USB device 104 to determine if acharging port is attached to the USB port 106 of the USB device 104 asdescribed below. The USB device 104 is attached to a host, which is acharging port, via the USB port 106. Although the charging port is notshown in FIG. 1, the lines D+ and D− are connected to a resistor 108that is located in the charging port as described in greater detailbelow. The value of the resistor 108 may be between zero and 250 ohms.Because the value of the resistor 108 is so low, it is sometimesreferred to as a short between the lines D+ and D−. It is noted that theuse of the resistor connected between the line D+ and D− is an exampleof a charging port configuration and that other circuits may beconnected to the lines D+ and D−.

As briefly described above, the USB port 106 has four conductors orlines, which are referred to individually as Vbus, Ground (GND), datapositive (D+), and data minus (D−). Vbus and GND are not shown connectedto any components in the charge detection circuit 100. Rather, Vbus andGND are used to supply power to the USB device 104 and to chargebatteries used to operate the USB device 104. The data lines D+ and D−are used to transmit data between the USB device 104 and the host. Asdescribed below, lines D+ and D− are also use to detect whether a hostis attached to the USB device 104 and to indicate the type of hostattached thereto.

The line D+ is connected to a voltage source VDP_SRC by way of a switchSW1. The voltage source VDP_SRC may provide a voltage between 0.5 and0.7 volts. The line D+ is also connected to a current source 112 by wayof a switch SW2. The current source 112 may provide a current of apredetermined amount, which is referred to as IDP_SRC. The currentsource 112 may supply a current of approximately 7-12 uA. In addition,line D+ is connected to a physical layer interface (PHY) 114, which isalso referred to as a USB transceiver. The connection to the physicallayer interface 114 is represented by a leakage resistance 116 having avalue of RDAT_LKG and a leakage voltage, which is referred to asVDAT_LKG. The values of RDAT_LKG may be approximately 300 k ohms and thevalue of VDAT_LKG may be between zero and 3.6 volts.

The line D− is connected to a pull down resistor 118 by a switch SW3.The resistor 118 has a value referred to as RDM_DWN, which may have avalue of between 14.25 k ohms and 24.8 k ohms. The line D− is alsoconnected to the non-inverting side of a voltage comparator 120 and aninverting input of an AND gate 122 by a switch SW4. The non-invertinginput of the voltage comparator 120 is also connected to a current sink126. The current sink 126 is sometimes referred to as being activatedwhen the switch SW4 closes. As with the line D+, the line D− is alsoconnected to the physical layer interface 114 wherein the connection isrepresented by the leakage resistance Rdat_lkg and the leakage voltageVdat_lkg.

The inverting input of the voltage comparator 120 is connected to areference voltage VDAT_REF, which may be between 0.25 and 0.4 volts.Accordingly, the voltage comparator 120 compares the voltage on line D−to the reference voltage VDAT_REF. The output of the voltage comparator120 is an input to the AND gate 122. The output of the AND gate 122provides a signal to the physical layer interface 114 as to whether acharging port has been connected to the USB device 104. A high valuefrom the AND gate 122 is indicative of a charging port connected to theUSB device 104.

Having described the USB device 104, its operation for detecting anattachment to a charging port will now be described. The USB device 104first detects that a USB cable is attached by way of a proceduresometimes referred to as “VBUS detect”. This detection may be achievedby conventional methods of monitoring Vbus. For example, when thevoltage on Vbus transitions to a value higher than 0.8V, it isindicative of a USB cable being attached to the USB device 104. When theUSB cable is determined to be attached to the USB device 104, the USBdevice is sometimes referred to as being in “session valid”.

When the attachment has been established and the USB device is insession valid, a “data contact detect” is performed, which determineswhen the lines D+ and D− are electrically connected to the host. Insummary, a data contact detect occurs after the session valid when thevoltage on the line D+ goes low. In a BC1.1 device, the current source112 is activated by closing switch SW2. In addition, switch SW3 isclosed, which connects the line D− to ground via the resistor 118. Insome host devices, the host device will pull the voltage on the line D+low by way of a pull down resistor in the host device. In other devices,the host will connect the line D+ to the line D−. Because the line D− ispulled down by the resistor 118, the line D+ will go low when the hostdevice is connected to the USB device 104. In any event, data contactdetect occurs when the voltage on the line D+ goes low after sessionvalid.

USB devices per BC1.1 do not have a time out procedure if they do notdetect that the voltage on line D+ has gone low after a session valid.If the voltage on the line D+ is driven high by the charging port, theBC1.1 device will never be able to obtain a data contact detect. BC1.2devices do not have this issue because they will skip the data contactdetection and move on to the primary detection, described below, after aperiod. The charging port and methods of operating the charging portdescribed herein monitor the lines D− and D+. If the line D− is pulleddown while the line D+ is not pulled down, the charging port determinesthat the connected device is a BC1.1 device and proceeds to a dedicatedcharging port mode per BC1.1.

When data contact detect is complete, the USB device 104 proceeds todetermine if the host is a charging port by performing a “primarydetection”. The USB device 104 closes switch SW1, which turns on thevoltage source 110. The switch SW4 is also closed, which connects thecurrent sink 126 to the line D−. If a host other than a charging port isattached to the line D−, the host pulls the voltage on the line D− belowthe voltage VDAT_REF, so the CHG_DET line is low, indicating that nocharging port is connected to the USB port 106. If the voltage on lineD− is greater than the voltage VDAT_REF and below a logic one voltage,then the CHG_DET line is high indicating that the USB device 104 isattached to a charging port.

A USB device under BC1.1 may have problems if the line D− is driven highby the host device and the USB device was able to pass beyond the datacontact detect. By driving the line D− too high, it could be interpretedas a logic high by the AND gate 122 and drive the charge detection lineCHG_DET low, so the USB device 104 detects that no charging port isconnected. In such a situation, the host described herein may determinethat the USB device 104 is a BC1.1 device. In order to proceed withcharging, the power may be removed from the USB device and a shortingresistor may be connected between D+ and D− by the host device whichindicates to the USB device 104 that a charging port is attachedthereto.

Some other USB devices are somewhat different than the BC1.1 devices andmay conflict with BC1.1 devices. For example, one manufacturer producesUSB devices and corresponding charging ports or adapters (referred toherein collectively as charging ports) that use different charge andcharge detection specifications. In these specifications, the chargingports output specific voltages through predefined impedances on thelines D+ and D− that are indicative of the type of charging portconnected to the USB device. It follows that this manufacturer producesUSB devices that monitor the voltages on the lines D+ and D− todetermine the type of charging port that is connected thereto. In oneembodiment of these devices, a voltage of approximately 2.7 volts isoutput on the line D− and a voltage of approximately 2.0 volts is outputon the line on D+. The voltage configuration indicates that the chargingport is configured for a first type of USB device that charges per aspecific charging specification. However, a second type of charging portoutputs approximately 2.0 volts on the line D− and approximately 2.7volts on the line D+. This voltage configuration is indicative of acharging port configured for a second type of USB device. The secondtype of USB device may draw significantly more current during batterycharging than the first type of USB device.

Many of the BC1.1 USB devices are not able to recognize the chargingport from the above-described manufacturer. When the above-describedcharging port is attached to the BC1.1 device, the line D+ is drivenhigh by the charging port. Accordingly, the BC1.1 device cannot proceedwith the data contact detect because the voltage on the line D+ willnever go low. In addition, the charging ports drive the voltage on theline D− to a voltage that may be high enough to where it could be alogic high. In doing so, the CHRG_DET line is driven to a logic low. Ifthe BC1.1 USB devices are able to proceed beyond data contact detect,they may not recognize that a charging port is attached thereto and donot enter a charging mode. Accordingly, the BC1.1 USB devices areattached to charging ports, but they do not charge their batteries.

A schematic diagram of a USB charging port 200 that can determine if aUSB device is a BC1.1 device or if the USB device is of a manufacturerusing a different charging specification as described above is shown inFIG. 2.

The charging port 200 has a USB port 202 that is attachable to a USBcable, which in turn is attachable to the USB port 106 on the USB device104. The USB port 202 includes the same lines as described above, VBUS,GND, D+, and D−. The line VBUS is connected to a current monitor 206that monitors the current flowing in the line VBUS. Accordingly, thecurrent monitor 206 monitors the current used by the USB device when itis charging. The GND line is connected to a conventional ground.

The line D− is connected to a node 210 on a switch SW5 by way of a line212. The line D+ is connected to a node 214 on a switch SW6 by way of aline 216. The switches SW5 and SW6 may be separate as shown in FIG. 2,or they may be a single switch. Detection and controls circuits 220 areconnected between the line 212 and the line 216. The detection andcontrol circuits 220 may measure the voltages on the lines 212 and 216and control the state of the switches SW5 and SW6.

The switch SW5 has three contacts, which are referred to individually asthe first contact 226, the second contact 228, and the third contact230. The contacts 226, 228, 230 are connectable to the node 210. In someembodiments, the switch SW5 is an electronic switch. The switch SW6 isvery similar to the switch SW5 and has three contacts, a first contact232, a second contact 234, and a third contact 236. The contacts 232,234, 236 are connectable to the node 214. The switch SW6 may also be anelectronic switch.

The first node 226 of the switch SW5 is connected to the line D− of ahost controller 240. The host controller may be a conventional hostcontroller that transmits and receives data on the lines D+ and D−. Thefirst contact 232 of the switch SW6 is connected to the line D+ of thehost controller. The second contact 228 of the switch SW5 is connectedto a node 240 of a switch SW7 that is part of a power supply 242. Thepower supply 242 applies voltages onto the lines D+ and D− as describedbelow. The second contact 234 of the switch SW6 is connected to a node244 of a switch SW8 that is also part of the power supply 242.

The third contact 230 of the switch SW5 is connected to a resistor 108,which is the same resistor 108 of FIG. 1. The third contact 236 of theswitch SW6 is also connected to the resistor 108. It follows that whenthe switches SW5 and SW6 are connected to the third contacts 230, 236,the resistor 108 is connected between the data lines D+ and D−. Such aconfiguration is indicative to a BC1.1 and a BC1.2 USB device that it isconnected to a charging port as described above.

The power supply 242 will now be described. The switch SW7 has a firstcontact 250 and a second contact 252. The switch SW8 has a first contact254 and a second contact 256. The first contact 250 of the switch SW7 isconnected to the second contact 256 of the switch SW8. The first contact250 of the switch SW7 is also connected to a first voltage source 260 byway of a resistor 262. The first voltage source 260 supplies a voltageof approximately 2.7 volts. In the embodiment of the power supply 242described herein, value of the resistor 262 is approximately 10 k ohms;however, the value of the resistor 262 may be different. The firstcontact of the switch SW8 is connected to the second contact 252 of theswitch SW7. The first contact 254 of the switch SW8 is also connected toa second voltage source 264 by way of a resistor 266. The second voltagesource 264 outputs a voltage of approximately 2.0 volts and the value ofthe resistor 266 is approximately 10 k ohms. As with the resistor 262,the value of the resistor 266 may be different than 10 k ohms. Thevoltages described above refer to an embodiment of a charging port. Itis noted that other voltage values may be used in different embodiments.

The switches SW7 and SW8 are in a first mode when the nodes 240, 244 areconnected to the first ports 250, 254. In the first mode, the voltage ofthe first voltage source 260 is output on the node 240 and the voltageof the second voltage source 264 is output on the node 244. The switchesSW7 and SW8 are in a second mode when the nodes 240, 244 are connectedto the second ports 252, 256. When the switches SW7, SW8 are in thesecond mode, the voltage from the first voltage source 260 is output onthe node 244 and the voltage from the second voltage source 264 isoutput on the node 240.

The operation of the charging port 200 will now be described withadditional reference to the flow chart 300 of FIG. 3, which describesthe operation of the power supply 200.

As described above, there are different USB devices to which thecharging port 200 may be attached, therefore, the charging port has todetermine which type of USB device it is attached to. Unlike theprotocol of the BC1.1 and BC1.2 specifications, the manufacturerdescribed above outputs voltages on the lines D+ and D− from thecharging port. The USB device measures the voltages on the lines D+ andD−. If the line D+ is approximately 2.0 volts and the voltage on theline D− is approximately 2.7 volts, the USB device determines that it isconnected to a first type of charging port that is able to output afirst level of current. If the voltage on line D− is approximately 2.0volts and the voltage on line D+ is approximately 2.7 volts, then theUSB device determines that a second type of charging port is connectedwherein the second type of charging port is able to supply more currentthan the first type of charging port. As described below, the chargingport 200 described herein is able to be used with both types of USBdevices.

The first step in battery charging is to attach the USB device 104 tothe charging port as shown in step 302 of the flow chart 300. Theabove-described VBUS detect is then performed.

The next step is to determine if a BC1.1 or BC1.2 compliant USB deviceis attached to the charging port 200 as described in step 304 of flowchart 300. A BC1.1 device is sometimes referred to as an alpha device.As described above, a USB device that is compliant with BC1.1 or BC1.2will sink the current on the data line D− to ground or pull down thevoltage on the voltage on the line D−. It follows that the voltage onthe line D− measured at the detect and control circuit 220 will be belowwhat it should be without the current sink 126 or the pull down resistor118 connected thereto. The line D+ on a BC1.1 or BC1.2 device isconnected to the voltage supply 110, which sources (but does not sink)between 0.5 and 0.75 volts. The voltages on these lines can be measuredby the detection and control circuits 220. If the voltage on the line D−is less than what it would be but for the current sink, and the chargingvoltage present on the line D+ is maintained, then the USB device islikely compliant with BC1.1. The period that the line D+ is maintainedmay be greater than 1.5 seconds. In other embodiments, the period may begreater than or approximately equal to 0.25 seconds.

When applied specifically to the charging port 200, voltages are appliedto the lines D+ and D− via the power supply 242, as described in step303, and the voltages on lines D+ and D− are measured at the detectionand control circuits 220. The voltage on line D+ should be high becausethe voltage supply 110 can only source a current. For example, if thepower supply 264 applies approximately 2.0 volts on the line D+, thedetection and control circuit 220 should measure approximately 2.0volts. The voltage on line D− should be lower than the voltage suppliedby the power supply 242 because the USB device 104 sinks the line D− toground. Applying the voltages to the lines D+ and D− is achieved byconnecting the node 210 to the second port 228 and connecting the node214 to the second port 234. The lines D+ and D− are then connected tothe voltage sources 260, 264 by way of the impedances 262, 266. Thepower supply 242 can be placed in the first mode so that 2.7 volts isapplied to the line D− and 2.0 volts is applied to the line D+.

As briefly described above, the voltages on the lines D+ and D− aremeasured by the detection and control circuits 220. The voltage on theline D+ should be about 2.0 volts, or within a predetermined range of2.0 volts, such as 1.9 to 2.1 volts. The voltage on the line D− shouldbe lower than the voltage applied by the voltage supply 242. Forexample, the voltage may be less than approximately 2.4 volts. In someembodiments, the voltage on the line D− may be less than 2.6 volts or itmay be less than 0.1 volts less than the voltage supplied by the voltagesource 260. If these criteria are met and maintained for a predeterminedperiod, the charging port 200 determines that the USB device iscompliant per BC1.1, which is sometimes referred to as being an alphadevice. The processing then proceeds to step 306 of the flow chart 300.Otherwise, the USB device has a charging specification of anothermanufacturer and processing proceeds to step 308 of the flowchart 300.

If the USB device is compliant per BC1.1, the charging port 200 will setthe correct battery charging specifications for such a device. In theembodiment of the charging port 200 described herein, the resistor 108will be connected between the lines D+ and D− to indicate that thecharging port 200 is a charging port per BC1.1. In order to recycle theUSB device, step 306 removes the power from the USB device. This may beachieved by disconnecting VBUS from the USB device. By recycling the USBdevice 104, the process of determining the type of USB device connectedto the charging port starts over with the resistor 108 connected betweenthe lines D+ and D−.

Connecting the resistor 108 to the lines D+ and D− is performed bysetting the switch SW5 for the node 210 to connect to the third contact230. Likewise, the switch SW6 is set for the node 214 to connect to thethird contact 236. In this mode, the line D+ is essentially shorted tothe line D− because they are connected by the resistor 108 as describedin step 310 of the flow chart 300. Power is then returned to the USBdevice by the charging port 200 as described in step 312 of the flowchart 300. Because the lines D− and D+ are shorted, the USB device willrecognize the charging port 200 correctly as a dedicated charging portand will charge the battery per a battery charging specification.

Returning to step 304 of the flow chart 300, the USB device may havebeen determined to be from a manufacturer that does not comply with theabove-described battery charging specifications. Rather, themanufacturer uses a specification wherein voltages are applied to thelines D+ and D− by the charging port to indicate that it is a dedicatedbattery charger, per a proprietary specification as described above. TheUSB device measures the voltages on the lines D+ and D− to determinethat a dedicated charging port is connected and then the USB devicecommences charging.

In the embodiments described herein, the manufacturer has a first orolder specification for older USB devices that draw lower current thannewer USB devices using a newer or second specification. For referencepurposes, the older USB devices that draw less current are referred toas beta devices and the newer USB devices that draw more current arereferred to as gamma devices. The older devices may draw less than 550mA and the newer devices may draw approximately 2.0 amperes. Oldercharging ports may not be able to supply the current required to chargethe newer devices. However, the newer USB devices may recognize theolder charging ports and may, upon detection of an older charging port,limit their current draw to the lower current supplied by the oldercharging ports. The charging port 200 described herein is able to detectwhether the manufacturer's USB device is an older type that draws lesscurrent than a newer type and to supply the appropriate current.

The process of determining the type of device commences with applyingvoltages from the charging port 200 to the USB device via the lines D+and D− indicating that the charging port 200 is configured for an olderUSB device that draws less current than a newer USB device. This firststep is shown at step 316 of the flow chart 300. In the embodiment ofthe charging port 200 of FIG. 2, this first step is accomplished byconnecting the first voltage source 260 to the line D− and connectingthe second voltage source 264 to the line D+. More specifically, theswitches SW7 and SW8 are placed in the first mode and the nodes 210, 214are connected to the second ports 228, 234. Accordingly, 2.7 volts isoutput on the line D− and 2.0 volts is output on the line D+.

The current drawn from the charging port 200 is measured at step 318.More specifically, the current drawn on VBUS to charge the USB device ismeasured by the current monitor 206. A decision is made at step 320 todetermine if the current drawn is greater than a predetermined value. Ifthe current drawn is greater than a predetermined value, the USB deviceis likely a second or newer type of device and processing proceeds tostep 322 where the voltages on D+ and D− are swapped. In someembodiments, the predetermined current value is approximately 750 mA.With regard to the charging port 200, the states of the switches SW7 andSW8 are changed. At step 324, the current drawn on VBUS is measuredagain. Because the charging port 200 is in a state to provide highcurrent to a newer USB device, the current drawn on VBUS should increaseif the USB device is a newer type device. For example, the current drawnmay increase to approximately 900 mA or greater.

A decision as to whether the current drawn on VBUS has increased isshown at step 326 of the flow chart 300. If the current has increased,the USB device is a newer type device and needs the higher currentprovided by the present configuration of the charging port 200. Thevoltages on the lines D+ and D− remain at 2.7 and 2.0 voltsrespectively, and the charging port 200 provides charging power per thespecification of the newer USB device.

If, at step 326, the current drawn by the USB device did not increase,the USB device is an older device, so the voltages on D+ and D− are setto reflect the older device as described in step 330. The charging port200 then commences to charge the USB device per the older chargingspecification as described in step 332. It is also noted that if thedecision from step 320 is negative, the USB device is an older deviceand will charge per the older specifications as described in step 332.

While illustrative and presently preferred embodiments of the inventionhave been described in detail herein, it is to be understood that theinventive concepts may be otherwise variously embodied and employed andthat the appended claims are intended to be construed to include suchvariations except insofar as limited by the prior art.

What is claimed is:
 1. A USB device connectable to a USB charging port,the USB charging port comprising a first data line D+, a second dataline D−, and a power line, comprising: means for attaching the USBdevice to a USB charging port; means for applying power to the USBdevice by way of the power line; means for applying a first voltage tothe line D+ at the USB charging port; means for applying a secondvoltage to the line D− line at the USB charging port; and means formonitoring the current drawn on the power line; if the current drawn onthe power line is below a first predetermined current value, thendetermining that the USB device is of a beta type; further comprising:means for applying the first voltage to said line D− at the USB chargingport; means for applying the second voltage to said line D+ at the USBcharging port; means for monitoring the current drawn on the power line,wherein the USB device is of a gamma type if the current drawn on thepower line increases above a second predetermined current value; andmeans for applying the first voltage to the line D+ and applying thesecond voltage to the line D− if the current does not increase above thepredetermined value.
 2. A USB device connectable to a USB charging port,the USB charging port comprising a first data line D+, a second dataline D− and a power line, comprising: a connector in the USB deviceconnectable via a USB cable to a USB charging port; the power line inthe USB cable connectable to apply power to the USB device; the line D+connectable to apply a first voltage at the USB port; the line D−connectable to apply a second voltage at the USB port; a monitor circuitmonitoring the current drawn on the power line when connected to the USBdevice; a circuit determining if current drawn on the power line isbelow a first predetermined current value indicating that the USB deviceis of a beta type; the line D− applying a first voltage at the USB portwhen connected to a USB cable; the line D+ applying a second voltage atthe USB port when connected to a USB cable; the monitor circuit furthermonitoring the current drawn on the power line when connected to the USBdevice; a controller detecting that the USB device is of a gamma type ifthe current drawn on the power line increase above a secondpredetermined current value when power is applied to the USB device.